<template>
  <view @click="handleClick">
    <slot></slot>
  </view>

</template>

<script>
export default {
  props: ["list", "index"],
  mounted () {
    // console.log(this.list);
  },
  methods: {
    handleClick () {
      console.log(this.list[this.index].id);
      // 将数据缓存下来
      getApp().globalData.imgList = this.list;
      getApp().globalData.imgIndex = this.index;
      // 手动跳转到图片详情页
      uni.navigateTo({ url: '/pages/imageDetail/index' })
    }
  }
}
</script>

<style>
</style>